    

<?php

include_once '../dao/LoginDao.php';
include_once '../model/Login.php';

$login = new Login();

$login->setEmail($_POST['txtEmail']);
$login->setPasswd($_POST['txtSenha']);

$dao = new LoginDao();

$result = $dao->auth($login); 

echo $result; 



if ($result) {
    session_start();
    echo   $_SESSION['auth'] = "true";
    header('Location:../views/pages/principal.php?auth="' . $_SESSION['auth'] . '"');
}else{
    echo $_SESSION['auth'] = "false"; 
    header('Location:../session.php');
}


?>
        


